Imaging apparatus and method for controlling the same

ABSTRACT

An apparatus includes an imaging unit configured to photoelectrically convert an object image incident via a focus lens to acquire image data; a detection unit configured to detect a size and a position of an object based on the acquired image data; an adjustment unit configured to execute focus adjustment by acquiring a focus signal indicating a focusing state of the focus lens based on the image data while moving the focus lens, and moving the focus lens based on the focus signal; and a control unit configured to execute an operation if the detected size has changed, and to change the operation if the detected position has changed while the detected size has not changed.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an imaging apparatus and a method forcontrolling the imaging apparatus, and particularly, to a techniquesuitable for use in focus adjustment during the wait for shooting.

2. Description of the Related Art

Conventionally, in an electronic still camera, a video camera, or thelike, when an autofocus (hereinafter, referred to as AF) is executed, amethod is used in which a lens position where a high-frequency componentof a luminance signal obtained from an image sensor, such as acharge-coupled device (CCD), (hereinafter referred to as an AFevaluation value) is maximized is determined to be an in-focus position.As one of these methods, the following scanning method is known.

In a first scanning method, the AF evaluation value obtained from apredetermined area (hereinafter referred to as an AF frame) in an imagesensor is stored while driving a focus lens throughout a scanning range.Then, a focus lens position corresponding to the maximum value thereofamong the stored AF evaluation values (hereinafter referred to as a peakposition) is determined to be an in-focus position. The in-focusposition is a lens position to be assumed that focus is adjusted on anobject.

As a second scanning method, there is a technique of detecting an objectto be focused using an image signal obtained from an image sensor toexecute an AF based on information about the detected object (size andposition), thereby adjusting focus at a high speed.

For example, in Japanese Patent Application Laid-Open No. 2006-201282, atechnique is discussed in which based on the size of the detected face,an approximate distance is obtained, then, based on the obtaineddistance, a position determined to be a scanning start point isdetermined, and the far side farther than that position is not scanned,thereby shortening an AF time. Further, for example, in Japanese PatentApplication Laid-Open No. 2009-31760, a technique is discussed in whicha searching range of scanning by a focus lens is set based on atime-series change in size of the detected face.

However, in a digital camera discussed in the above-described JapanesePatent Application Laid-Open No. 2006-201282 and an imaging apparatusdiscussed in Japanese Patent Application Laid-Open No. 2009-31760, ascanning range or a searching range is set based on the size of anobject. Accordingly, when the position of the object is changed, abackground-focused state may occur in which focus is adjusted on thebackground located far from the main object.

This is because when the position of the object has been changed, an AFframe may move away from the object.

SUMMARY OF THE INVENTION

According to an aspect of the present invention, an apparatus includesan imaging unit configured to photoelectrically convert an object imageincident via a focus lens to acquire image data; a detection unitconfigured to detect a size and a position of an object based on theacquired image data; an adjustment unit configured to execute focusadjustment by acquiring a focus signal indicating a focusing state ofthe focus lens based on the image data while moving the focus lens, andmoving the focus lens based on the focus signal; and a control unitconfigured to execute an operation if the detected size has changed, andto change the operation if the detected position has changed while thedetected size has not changed.

According to another aspect of the present invention, a method forcontrolling an apparatus includes photoelectrically converting an objectimage incident via a focus lens to acquire image data, detecting a sizeand a position of an object based on the acquired data, executing focusadjustment by acquiring a focus signal indicating a focusing state ofthe focus lens based on the image data while moving the focus lens, andmoving the focus lens based on the focus signal, and executing anoperation if the detected size has changed, and to change the operationif the detected position has been changed while the detected size hasnot changed.

Further features and aspects of the present invention will becomeapparent from the following detailed description of exemplaryembodiments with reference to the attached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of the specification, illustrate exemplary embodiments, features,and aspects of the invention and, together with the description, serveto explain the principles of the invention.

FIG. 1 is a block diagram illustrating a configuration example of animaging apparatus.

FIG. 2 is a flowchart illustrating a continuous scanning operation bythe imaging apparatus.

FIG. 3 is a flowchart illustrating a detection operation for a change insize of an object by the imaging apparatus.

FIG. 4 is a flowchart illustrating a detection operation for a change inposition of an object by the imaging apparatus.

FIG. 5 is a flowchart illustrating a continuous scanning operation bythe imaging apparatus.

FIG. 6 is a flowchart illustrating a detection operation for a change inposition of an object by the imaging apparatus.

DESCRIPTION OF THE EMBODIMENTS

Elements of one embodiment may be implemented by hardware, firmware,software or any combination thereof. The term hardware generally refersto an element having a physical structure such as electronic,electromagnetic, optical, electro-optical, mechanical,electro-mechanical parts, etc. A hardware implementation may includeanalog or digital circuits, devices, processors, applications specificintegrated circuits (ASICs), programmable logic devices (PLDs), fieldprogrammable gate arrays (FPGAs), or any electronic devices. The termsoftware generally refers to a logical structure, a method, a procedure,a program, a routine, a process, an algorithm, a formula, a function, anexpression, etc. The term firmware generally refers to a logicalstructure, a method, a procedure, a program, a routine, a process, analgorithm, a formula, a function, an expression, etc., that isimplemented or embodied in a hardware structure (e.g., flash memory).Examples of firmware may include microcode, writable control store,micro-programmed structure. When implemented in software or firmware,the elements of an embodiment may be the code segments to perform thenecessary tasks. The software/firmware may include the actual code tocarry out the operations described in one embodiment, or code thatemulates or simulates the operations. The program or code segments maybe stored in a processor or machine accessible medium. The “processorreadable or accessible medium” or “machine readable or accessiblemedium” may include any medium that may store or transfer information.Examples of the processor readable or machine accessible medium that maystore include a storage medium, an electronic circuit, a semiconductormemory device, a read only memory (ROM), a flash memory, an erasableprogrammable ROM (EPROM), a floppy diskette, a compact disk (CD) ROM, anoptical storage medium, a magnetic storage medium, a memory stick, amemory card, a hard disk, etc. The machine accessible medium may beembodied in an article of manufacture. The machine accessible medium mayinclude information or data that, when accessed by a machine, cause themachine to perform the operations or actions described above. Themachine accessible medium may also include program code, instruction orinstructions embedded therein. The program code may include machinereadable code, instruction or instructions to perform the operations oractions described above. The term “information” or “data” here refers toany type of information that is encoded for machine-readable purposes.Therefore, it may include program, code, data, file, etc.

All or part of an embodiment may be implemented by various meansdepending on applications according to particular features, functions.These means may include hardware, software, or firmware, or anycombination thereof. A hardware, software, or firmware element may haveseveral modules coupled to one another. A hardware module is coupled toanother module by mechanical, electrical, optical, electromagnetic orany physical connections. A software module is coupled to another moduleby a function, procedure, method, subprogram, or subroutine call, ajump, a link, a parameter, variable, and argument passing, a functionreturn, etc. A software module is coupled to another module to receivevariables, parameters, arguments, pointers, etc. and/or to generate orpass results, updated variables, pointers, etc. A firmware module iscoupled to another module by any combination of hardware and softwarecoupling methods above. A hardware, software, or firmware module may becoupled to any one of another hardware, software, or firmware module. Amodule may also be a software driver or interface to interact with theoperating system running on the platform. A module may also be ahardware driver to configure, set up, initialize, send and receive datato and from a hardware device. An apparatus may include any combinationof hardware, software, and firmware modules.

Various exemplary embodiments, features, and aspects of the inventionwill be described in detail below with reference to the drawings.

FIG. 1 is a block diagram illustrating a configuration example of animaging apparatus 100 according to an exemplary embodiment of thepresent invention. In FIG. 1, a photographic lens 101 includes a zoomingmechanism. A focus lens 102 executes focus adjustment for adjustingfocus on an image sensor, which will be described below. An AFprocessing unit 103 drives the focus lens 102. An image sensor 104executes photoelectric conversion for converting an object imageincident via the focus lens 102 into an electric signal to acquire imagedata. An analog-to-digital (A/D) conversion unit 105 includes acorrelated double sampling (CDS) circuit for removing an output noise onthe image sensor 104 and a nonlinear amplifier circuit to be executedbefore A/D conversion.

An image processing unit 106 extracts a signal component of a specificfrequency band concerning luminance of an object from an output signalfrom the A/D conversion unit 105. Color information or the like in thepredetermined area of an image can be acquired using the imageprocessing unit 106. A system control unit (hereinafter referred to as acentral processing unit (CPU)) 107 controls a system such as a shootingsequence to control an operation of the whole imaging apparatus in thepresent exemplary embodiment. A shooting mode switch 108 executes asetting such as switching on or off a face detection mode. A main switch109 is operable for inputting a power source to a system. A switch(hereinafter referred to as SW1) 110 is operable for executing ashooting standby operation such as an AF and an AE. A shooting switch(hereinafter referred to as SW2) 111 is operable for executing shootingafter the operation of the SW1.

A face detection module 112 executes detection of a face using an imagesignal processed by the image processing unit 106 to transmit one or aplurality of pieces of the detected face information (position, size,and reliability) to the CPU 107. A moving body detection unit 113detects whether an object and a background in a screen are moving totransmit moving body information to the CPU 107. Specifically, themoving body detection unit 113 compares two images lining in time seriesamong image signals processed by the image processing unit 106 to detectmoving body information on the object/background (amount of operation,position, and range) from the difference information thereof.

An angular velocity sensor unit 114 detects an angular velocity of acamera itself to transmit motion information on the camera to the CPU107. Whether the camera is made ready in a state of a portrait positionor a landscape position can also be detected using the angular velocitysensor unit 114. An acceleration sensor unit 115 detects acceleration ofthe camera itself to transmit motion information on the camera to theCPU 107. Whether the camera is made ready with the photographic lens 101upward or downward can also be detected using the acceleration sensorunit 115. The imaging apparatus 100 further has a high-speed internalmemory (e.g., random access memory etc., hereinafter referred to asdynamic random access memory (DRAM)) 116.

Next, referring to a flowchart in FIG. 2, a continuous scanningoperation will be described, which is executed when an object isdetected by an imaging apparatus, according to a first exemplaryembodiment of the present invention. In FIG. 2, an operation, whichstores an AF evaluation value obtained from an AF frame in the imagesensor 104 while moving the focus lens 102, moves the focus lens 102based on the AF evaluation value, and executes focus adjustment, refersto a scanning operation (focus adjustment operation). The AF evaluationvalue in FIG. 2 is an example of a focus signal that indicates afocusing sate of the focus lens 102.

In step S201, the CPU 107 executes detection of an object. In thepresent exemplary embodiment, the object is a face. However, if a sizeand a position can be detected, the object may not be the face. Indetection of the object, the face is detected by the face detectionmodule 112.

Next, in step S202, the CPU 107 detects whether a size of the face ischanged. The detail of processing to be executed in step S202 will bedescribed below referring to FIG. 3. Next, in step S203, the CPU 107detects whether a position of the face is changed. The detail ofprocessing to be executed in step S203 will be described below referringto FIG. 4.

Next, in step S204, the CPU 107 executes determination of whether theobject is in a state of a change in size of the face detected in stepS202. As the result of this determination, if it is in a state in whichthe size of the face is changed (YES in step S204), the processingproceeds to step S205. Further, if it is in a state in which the size ofthe face is not changed (NO in step S204), the processing proceeds tostep S217.

In step S217, the CPU 107 executes determination of whether shooting isinstructed. As the result of this determination, if shooting isinstructed (YES in step S217), the continuous scanning operation indetecting the object ends. If the shooting is not instructed (NO in stepS217), the processing returns to detection of an object in step S201.

In step S205, the CPU 107 executes determination of whether the imagingapparatus is during a scanning operation. As the result of thisdetermination, if the imaging apparatus is not during the scanningoperation (NO in step S205), then in step S206, the CPU 107 executesdetermination of whether a position of the detected face is changed. Asetting operation for setting a focus detection area when the focusingsate of a focus lens is detected is changed according to the result ofthis determination. In other words, if it is determined that theposition of the face is not changed (NO in step S206), the processingproceeds to step S207. If it is determined that the position of the faceis changed (YES in step S206), the processing proceeds to step S208.

In step S207, the CPU 107 sets a normal scanning range that is a movingrange of the focus lens 102. The normal scanning range in the presentexemplary embodiment is an area five times as large as a focal depthwhich is a range to be considered that focus is adjusted on each of thenear side and the far side about a current focus lens position. On theother hand, in step S208, the CPU 107 sets a narrow scanning range andthe processing proceeds to step S209. The narrow scanning range is anarea narrower than the normal scanning range. In the present exemplaryembodiment, the narrow scanning range is an area half the normalscanning range.

In step S208, the narrow scanning range is set. Thus, when an AF framehas been located outside the object, even if a peak position of the AFevaluation value which is the scanned result has deviated to thebackground side, it becomes half the scanning range at a maximum.Accordingly, it can be prevented from greatly deviating. Further, in thepresent exemplary embodiment, a scanning start position is the far endof the scanning range, and a scanning end position is the near end ofthe scanning range.

After processing in step S207 or step S208 ends, the processing proceedsto step S209. In step S209, the focus lens 102 is moved. Next, in stepS210, the AF evaluation value in the moved focus lens position isacquired. Next, in step S211, the CPU 107 executes determination ofwhether the focus lens 102 has been moved to the scanning end position.

As the result of determination in step S211, when the focus lens has notbeen moved to the scanning end position (NO in step S211), then in stepS217, the CPU 107 executes determination of whether shooting isinstructed. On the other hand, when the focus lens has been moved to thescanning end position (YES in step S211), then in step S212, the CPU 107executes determination of whether the peak position of the AF evaluationvalue is detected. As the result of this determination, when the peakposition is detected (YES in step S212), then in step S213, the focuslens position is moved to the peak position. Thereafter, in step S217,the CPU 107 executes determination of whether shooting is instructed.

Further, as the result of determination in step S212, when the peakposition is not detected (NO in step S212), then in step S214, the CPU107 executes determination of whether the AF evaluation value ismaximized in the scanning start position or the scanning end position,in which climbing stops. As the result of this determination, whenclimbing stops (YES in step S214), then in step S215, the focus lensposition is moved to the end where climbing stops. Thereafter, in stepS217, the CPU 107 executes determination of whether shooting isinstructed. Furthermore, as the result of determination in step S214,when climbing does not stop (NO in step S214), then in step S216, thefocus lens position is moved to the center position of the scanningrange. Thereafter, in step S217, the CPU 107 executes determination ofwhether shooting is instructed.

Accordingly, the scanning operation is continuously executed. Thus,focus can continuously be adjusted to an object having motion in adistance direction. Further, when it has been determined to be in astate of a change in position, the scanning range is narrowed, therebyallowing an influence on the background-focused state to be suppressed.

Next, referring to a flowchart in FIG. 3, detection of a change in sizeof an object by the imaging apparatus according to the present exemplaryembodiment will be described. In step S301, the CPU 107 determineswhether the size of the detected object is changed. In determination ofa change in size, the CPU 107 executes determination based on whether adifference is detected between the size of the object to be stored inthe DRAM 116 in step S306 associated with the position of the focus lens102 and the size of the object acquired this time.

As the result of determination in step S301, when it is determined thatthe size of the object is changed (YES in step S301), the processingproceeds to step S302. In step S302, the CPU 107 determines whether thedifference is within a predetermined amount. As the result of thisdetermination, when the difference is equal to or larger than thepredetermined amount (NO in step S302), it is considered that the objectdetected this time is different from the object previously detected.

As the result of determination in step S301, when it is determined thatthe size of the object is not changed (NO in step S301), then in stepS303, the CPU 107 sets a size change counter to zero. Thereafter, instep S304, the CPU 107 determines whether the object is in a state of achange in size. This is determined by reading whether the state of achange in size is set in the DRAM 116. The size change counter is avalue which is stored in the DRAM 116 in order to determine whether thesize of an object has continuously been changed.

On the other hand, as the result of determination in step in S302, whenthe amount of change in size of the object is not within thepredetermined amount (NO in step S302), it is considered that theobjects are different. Thus, the processing proceeds to step S303, inwhich the CPU 107 sets the size change counter to zero. Next, in stepS304, as described above, the CPU 107 determines whether the object isin a state of a change in size.

As the result of determination in step S304, when it is in the state ofa change in size (YES in step S304), then in step S305, the CPU 107clears the state of a change in size which is stored in the DRAM 116.Next, in step S306, the CPU 107 stores the size of the object in theDRAM 116 and ends detection of a change in size of an object. On theother hand, as the result of determination in step S304, when it is notin the state of a change in size (NO in step S304), the processingdirectly proceeds to step S306. In step S306, the CPU 107 stores thesize of the object in the DRAM 116 and ends detection of a change insize of an object.

Further, as the result of determination in step S302, when the amount ofchange in size of the object is within the predetermined amount (YES instep S302), the processing proceeds to step S307, in which the CPU 107increments the size change counter by 1. Next, in step S308, the CPU 107compares the size change counter and the threshold value of the sizechange counter which is a value to be stored in the DRAM 116. Thethreshold value of the size change counter is a threshold value to bedetermined that the object moves in a deep direction if the size of theobject is continuously changed equal to or larger than that value. Ifthe size change counter is smaller than or equal to the threshold value(NO in step S308), then in step S306, the CPU 107 stores the size of theobject and then ends detection of a change in size of an object.Further, if the size change counter is larger than the threshold valueof the size change counter (YES in step S308), the processing proceedsto step S309. In step S309, the CPU 107 stores the state of a change insize in the DRAM 116. Next, in step S306, the CPU 107 stores the size ofthe object and then ends detection of a change in size of an object.

The size of the object is detected by the face detection module 112 whenthe object is a face. When the object is not a face, the size of theobject is detected from a change in color information acquired by theimage processing unit 106. For example, the size of the object can bedetected from a change in the same color area in an object area,luminance difference information to be detected by the moving bodydetection unit 113 in an object area, a change in in-focus distance inthe peak position of the continuously scanned result, or the like.

Next, referring to a flowchart in FIG. 4, detection of a change inposition of an object by the imaging apparatus according to the presentexemplary embodiment will be described. In step S401, the CPU 107determines whether a position of the detected object has been changed.In this determination of a change in position, the CPU 107 executesdetermination based on whether a difference is detected between theposition of the object stored in the DRAM 116 in step S406 and theposition of the object acquired this time.

As the result of this determination, when it is determined that theposition of the object is changed (YES in step S401), then in step S402,the CPU 107 determines whether the difference is within a predeterminedamount. In this determination, when the difference is equal to or largerthan the predetermined amount (NO in step S402), it is considered thatthe object detected this time is different from the object previouslydetected.

As the result of the determination in step S401, when it is determinedthat the position of the object is not changed (NO in step S401), theprocessing proceeds to step S403. In step S403, the CPU 107 sets aposition change counter to zero and then, in step S404, the CPU 107determines whether the object is in a state of a change in position.This is determined by reading whether the state of a change in positionis set in the DRAM 116. The position change counter is a value to bestored in the DRAM 116 in order to determine whether a position of anobject has continuously been changed.

As the result of determination in step S402, when the amount of changein position of the object is not within the predetermined amount (NO instep S402), it is considered that the objects are different. Thus, instep S403, the CPU 107 sets the position change counter to zero. Next,in step S404, the CPU 107 determines whether the object is in a state ofa change in position. As the result of this determination, when theobject is in the state of a change in position (YES in step S404), thenin step S405, the CPU 107 clears the state of a change in positionstored in the DRAM 116. Next, in step 406, the CPU 107 stores theposition of the object in the DRAM 116 and ends detection of a change inposition of an object. Further, as the result of determination in stepS404, when the object is not in the state of a change in position (NO instep S404), the processing directly proceeds to step S406. After theabove-described processing is executed, the CPU 107 ends detection of achange in position of an object.

On the other hand, as the result of determination in step S402, when theamount of change in position of the object is within the predeterminedamount (YES in step S402), the processing proceeds to step S407, inwhich the CPU 107 increments the position change counter by 1. Next, instep S408, the CPU 107 compares the position change counter and thethreshold value of the position change counter which is a value storedin the DRAM 116. The threshold value of the position change counter is athreshold value to be determined that the object moves in a vertical orhorizontal direction if the position of the object is continuouslychanged equal to or larger than that value. As the result of thisdetermination, if the position change counter is smaller than or equalto the threshold value (NO in step S408), then in step S406, the CPU 107stores the position of the object and then ends detection of a change inposition of an object.

As the result of determination in step S408, if the position changecounter is larger than the threshold value of the position changecounter (YES in step S408), then in step S409, the CPU 107 stores thestate of a change in position in the DRAM 116. Next, the processingproceeds to step S406. After the above-described processing is executed,the CPU 107 ends detection of a change in position of an object. Theposition of the object is detected by the face detection module 112 whenthe object is a face. When the object is not a face, the position of theobject can be detected from luminance difference information to bedetected by the moving body detection unit 113 in an object area or thelike.

Next, referring to a flowchart in FIG. 5, a continuous scanningoperation when an object is detected by the imaging apparatus accordingto a second exemplary embodiment of the present invention will bedescribed. In step S501, the CPU 107 executes detection of an object.Also in the present exemplary embodiment, the object is a face. The faceis detected by the face detection module 112.

Next, in step S502, the CPU 107 detects a change in size of the object.The detail of processing to be executed in step S502 is as describedabove referring to FIG. 3. Next, in step S503, the CPU 107 detects achange in position of the object. The detail of processing to beexecuted in step S503 will be described below referring to FIG. 6.

Next, in step S504, the CPU 107 determines whether the size of the facedetected in step S502 is in a state of a change. As the result of thisdetermination, when it is determined that the size of the face is in astate of a change (YES in step S504), the processing proceeds to stepS505. Further, if it is determined that the size of the face is not in astate of a change (NO in step S504), the processing proceeds to stepS516. In step S516, the CPU 107 determines whether shooting isinstructed. As the result of this determination, if shooting isinstructed (YES in step S516), the continuous scanning operation indetecting the object ends. Further, if shooting is not instructed (NO instep S516), the processing returns to detection of an object in stepS501.

In step S505, the CPU 107 determines whether the imaging apparatus isduring a scanning operation. As the result of this determination, if theimaging apparatus is not during the scanning operation (NO in stepS505), then in step S506, the CPU 107 executes a setting of a scanningrange. Thereafter, the processing proceeds to step S507. Further, if theimaging apparatus is during the scanning operation (YES in step S505),the processing proceeds to step S507. In the setting of the scanningrange to be executed in step S506, the CPU 107 sets an area five timesas large as a focal depth which is a range to be considered that focusis adjusted on each of the near side and the far side about a currentfocus lens position. Furthermore, in the present exemplary embodiment, ascanning start position is the far end of the scanning range, and ascanning end position is the near end of the scanning range.

Next, in step S507, the CPU 107 determines whether the position of theface is in a state of a change. As the result of this determination, ifit is determined that the position of the face is in a state of a change(YES in step S507), the processing proceeds to step S515, in which theCPU 107 moves the focus lens to the center position of the scanningrange. Thereafter, the CPU 107 executes determination of whethershooting is instructed. On the other hand, as the result ofdetermination in step S507, if it is determined that the position of theface is not in a state of a change (NO in step S507), then in step S508,the CPU 107 moves the focus lens. Next, in step S509, the CPU 107acquires an AF evaluation value in the moved focus position.

Next, in step S510, the CPU 107 determines whether the focus lens 102has been moved to the scanning end position. As the result of thisdetermination, if the focus lens 102 is not moved to the scanning endposition (NO in step S510), the processing proceeds to step S516. Instep S516, the CPU 107 executes determination of whether shooting isinstructed. Further, if the focus lens 102 is moved to the scanning endposition (YES in step S510), then in step S511, the CPU 107 determineswhether the peak position of the AF evaluation value is detected. As theresult of this determination, when the peak position is detected (YES instep S511), then in step S512, the CPU 107 moves the focus lens positionto the peak position. Thereafter, in step S516, the CPU 107 executesdetermination of whether shooting is instructed.

As the result of determination in step S511, when the peak position isnot detected (NO in step S511), then in step S513, the CPU 107determines whether the AF evaluation value is maximized in the scanningstart position or the scanning end position, in which climbing stops. Asthe result of this determination, when climbing stops (YES in stepS513), the processing proceeds to step S514. In step S504, the CPU 107moves the focus lens position to the end where climbing stops.Thereafter, in step S516, the CPU 107 executes determination of whethershooting is instructed. Further, as the result of determination in stepS513, when climbing does not stop (NO in step S513), the processingproceeds to step S515. In step S515, the CPU 107 moves the focus lensposition to the center position of the scanning range. Thereafter, instep S516, the CPU 107 executes determination of whether shooting isinstructed.

In the present exemplary embodiment, as described above, the scanningoperation is continuously executed. Thus, focus can continuously beadjusted to an object having motion in a distance direction. Further,when it has been determined that the object is in a state of a change inposition, the focus lens is not moved from the center position of thescanning range. Thus, when the distance of the object is not changed,scanning can be omitted, and the background-focused state can beprevented.

Next, referring to a flowchart in FIG. 6, a detection operation of achange in position of an object by the imaging apparatus according tothe present exemplary embodiment will be described. In step S601, theCPU 107 determines whether a position of the detected object has beenchanged. In determination of a change in position, the CPU 107 executesdetermination based on whether a difference is detected between theposition of the object stored in the DRAM 116 in step S406 and theposition of the object acquired this time.

As the result of determination in step S601, when it is determined thatthe position of the object is changed (YES in step S601), then in stepS602, the CPU 107 determined whether the difference is within spredetermined amount. As the result of this determination, when thedifference is equal to or larger than the predetermined amount (NO instep S602), it is considered that the object detected this time isdifferent from the object previously detected.

As the result of determination in step S601, when it is determined thatthe position of the object is not changed (NO in step S601), theprocessing proceeds to step S403. Further, as the result ofdetermination in step S602, if the amount of change in position of theobject is not within the predetermined amount (NO in step S602), it isconsidered that the objects are different. Thus, the processing proceedsto step S403. Since processing executed in steps S403 to S406 is similarto the above-described processing executed in FIG. 4, the detaildescription thereof will not be repeated.

On the other hand, as the result of determination in step S602, if theamount of change in position of the object is within the predeterminedamount (YES in step S602), the processing proceeds to step S607. Then,the CPU 107 determines whether the object is in a state of a change insize. This is determined by reading whether the state of a change insize is set in the DRAM 116. As the result of this determination, whenthe object is in the state of a change in size (YES in step S607), evenif the position of the object is changed, the CPU 107 does not set thestate of a change in position. Further, when the object is in the stateof a change in position (YES in step S404), the CPU 107 cancels thestate of a change in position. Thus, even if the scan is stoppedaccording to the state of a change in position, when the size of theobject is changed, the scan can be restarted.

As the result of determination in step S607, if it is determined thatthe object is in the state of a change in size (YES in step S607), theprocessing proceeds to step S403. Further, if it is determined that theobject is not in the state of a change in size (NO in step S607), theprocessing proceeds to step S407. Since processing to be executed insteps S407 to S409 is similar to the above-described processing to beexecuted in FIG. 4, the detail description thereof will not be repeated.

Further, the present invention is realized by executing processingbelow. In the processing, software (computer program) that realizes afunction in the above-described exemplary embodiment is supplied to asystem or an apparatus via a network or various types of computerreadable storage media. Then, a computer (or central processing unit(CPU), micro processing unit (MPU), etc.) in the system or the apparatusreads and executes a program.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all modifications, equivalent structures, and functions.

This application claims priority from Japanese Patent Application No.2009-189154 filed Aug. 18, 2009, which is hereby incorporated byreference herein in its entirety.

1. An apparatus comprising: an imaging unit configured to photoelectrically convert an object image incident via a focus lens to acquire image data; a detection unit configured to detect a size and a position of an object based on the acquired image data; an adjustment unit configured to execute focus adjustment by acquiring a focus signal indicating a focusing state of the focus lens based on the image data while moving the focus lens, and moving the focus lens based on the focus signal; and a control unit configured to execute an operation if the detected size has changed, and to change the operation if the detected position has changed while the detected size of the object has not changed.
 2. The apparatus according to claim 1, wherein changing the operation includes changing a moving range of the focus lens when the focus signal is acquired while moving the focus lens.
 3. The apparatus according to claim 1, wherein changing the operation includes not executing the focus adjustment.
 4. The apparatus according to claim 3, wherein if the detected size is changed, the control unit restarts executing the focus adjustment.
 5. The apparatus according to claim 1, wherein a change of the size includes a continuous change of the detected size.
 6. The apparatus according to claim 1, wherein a change of the position includes a continuous change of the detected position.
 7. A method for controlling an apparatus comprising: photoelectrically converting an object image incident via a focus lens to acquire image data; detecting a size and a position of an object based on the acquired data; executing focus adjustment by acquiring a focus signal indicating a focusing state of the focus lens based on the image data while moving the focus lens, and moving the focus lens based on the focus signal; and executing an operation if the detected size has changed, and to change the operation if the detected position has changed while the detected size has not changed.
 8. The method according to claim 7, wherein changing the operation includes changing a moving range of the focus lens when the focus signal is acquired while moving the focus lens.
 9. The method according to claim 7, wherein changing the operation includes not executing the focus adjustment.
 10. The method according to claim 9, further comprises restarting the executing the focus adjustment if the detected size is changed.
 11. The method according to claim 7, wherein a change of the size includes a continuous change of the detected size.
 12. The method according to claim 7, wherein a change of the position includes a continuous change of the detected position.
 13. A computer readable storage medium storing a computer-executable program of instructions for causing the computer to perform a method comprising: photoelectrically converting an object image incident via a focus lens to acquire image data; detecting a size and a position of an object based on the acquired data; executing focus adjustment by acquiring a focus signal indicating a focusing state of the focus lens based on the image data while moving the focus lens, and moving the focus lens based on the focus signal; and executing an operation if the detected size has changed, and to change the operation if the detected position has changed while the detected size has not changed.
 14. The computer readable storage medium according to claim 13, wherein changing the operation includes changing a moving range of the focus lens when the focus signal is acquired while moving the focus lens.
 15. The computer readable storage medium according to claim 13, wherein changing the operation includes not executing the focus adjustment.
 16. The computer readable storage medium according to claim 15, further comprises restarting the executing the focus adjustment if the detected size is changed.
 17. The computer readable storage medium according to claim 13, wherein a change of the size includes a continuous change of the detected size.
 18. The computer readable storage medium according to claim 13, wherein a change of the position includes a continuous change of the detected position. 